package com.itheima.scanner;


import java.util.Scanner;

public class ScannerDemo1 {
    public static void main(String[] args) {

        printInfo();
    }

    //定义一个方法，让用户键盘输入用户名和年龄，并打印出来
    public static void printInfo()
    {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String name = sc.nextLine();
        System.out.println("请输入年龄：");
        int age = sc.nextInt();
        System.out.println("name = " + name + ", age = " + age);

    }
}
